<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS Map</title>
</head>
<body>
<p>entries() 方法返回一个带有 Map 中 [key,values] 的迭代器对象</p>
<p id="demo"></p>

<script>
  //创建Map
  const fruits = new Map([
    ["apples", 500],
    ["bananas", 300],
    ["oranges", 200]
  ]);

  let text = "";
  for(const x of fruits.entries()){
    text += x + "<br/>";
  }

  document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>